From 9f723eceda580e52dab800eeebfff60801181201 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Tue, 19 Sep 2023 11:21:07 +0200 Subject: [PATCH 1/2] Add NPM publishing instructions to README --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a50c5d61..19b312b2 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,44 @@ $ ape run scripts/deploy_subscription_manager.py --network ethereum:local The networks used here are standard ape networks, you can see the full list with: ``` $ ape networks list -``` \ No newline at end of file +``` + +## NPM publishing process + +When a new smart contract is deployed it is needed to add to NPM package: + +https://www.npmjs.com/package/@nucypher/nucypher-contracts + +1. Download the last version of the package in a separated folder. Ropsten versions end in +`-ropsten`. + +```bash + $ npm i @nucypher/nucypher-contracts@x.y.z[-ropsten] +``` +2. Copy the `artifacts` folder and paste it into the nucypher-contracts local repository. Only the +files that we want to be uploaded must be kept. + +3. Add the artifacts (`abi` and `address`) and the source code of the smart contract. + +4. Leave only the artifacts/contracts of the Ethereum network were the contract to be added is +deployed (mainnet, Ropsten...). + +5. Change the `version` field of the `package.json`. See “Versioning” section. + +> If you are uploading testnet contracts, add `` to the semantic version. For +> example: "version": "0.3.0-ropsten" + +6. Publish the new version: + +```bash + $ npm publish +``` + +### NPM versioning + +We follow semantic versioning schema: + +https://docs.npmjs.com/about-semantic-versioning + +But with some changes: while the major version is 0, we always bump patch version instead of minor +version. From 8e90e9b52ed0a6ec7f1570cf4b5f4c03dafcd41d Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Tue, 19 Sep 2023 11:36:19 +0200 Subject: [PATCH 2/2] Apply PR suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Núñez --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 19b312b2..2da3e6e9 100644 --- a/README.md +++ b/README.md @@ -71,15 +71,15 @@ $ ape networks list ## NPM publishing process -When a new smart contract is deployed it is needed to add to NPM package: +For interoperability, we keep an NPM package with information of deployed smart contracts, such as address, ABI, etc. -https://www.npmjs.com/package/@nucypher/nucypher-contracts +The NPM package can be found in https://www.npmjs.com/package/@nucypher/nucypher-contracts and the process to update it is as follows: -1. Download the last version of the package in a separated folder. Ropsten versions end in -`-ropsten`. +1. Download the last version of the package in a separate folder. Testnet versions end in +`-` (e.g., `-goerli`). ```bash - $ npm i @nucypher/nucypher-contracts@x.y.z[-ropsten] + $ npm i @nucypher/nucypher-contracts@x.y.z[-] ``` 2. Copy the `artifacts` folder and paste it into the nucypher-contracts local repository. Only the files that we want to be uploaded must be kept.