
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
eris-contracts-promise
Advanced tools
This library is built to be able to work with Eris Contracts using JS and Promises
This library is built to be able to work with Eris Contracts using JS and Promises
You will need ErisDB installed and running Also this library is using ES6 so you will have to use node.js > 4.0.0
$ npm i --save eris-contracts-promise
First of all to be able to use this module you have to have your account:
On most of Linux based OS you will find them into ~/.eris/chains/<your-chain-name>/priv_validator.json
Finding out ErisDB IP
$ eris chains inspect <name of ErisDB server> NetworkSettings.IPAddress
After that you will be able to create new instance of library:
const ContractContent = `
contract GetSetContract {
uint public something;
function setSomething(uint newSome) {
something = newSome;
}
}
`
const ErisContracts = require('eris-contracts-promise')
// Your ErisRPC url
const rpcUrl = 'http://localhost:1337/rpc'
// Account details
const account = {
address: 'someaddress',
privKey: 'accountPrivateKey',
pubKey: 'accountPublicKey'
}
const ContractManager = ErisContracts.newContractManager(rpcUrl, account)
/**
* You have to compile your contract before using it.
*/
const compiled = require('solc').compile(ContractContent, 1).contracts['ContractName']
const abi = JSON.parse(compiled.interface)
// Create contract instance
const SomeContract = ContractManager.newContract(abi, compiled.bytecode.toUpperCase())
// Now we could work with newly created contract
SampleContract.at('address')
.then((contract) => {
// And call it's functions
return contract
.setSomething(1)
.then(() => {
//new value set
})
})
For more information please take a look into test
folder. You will find more examples in there.
FAQs
This library is built to be able to work with Eris Contracts using JS and Promises
The npm package eris-contracts-promise receives a total of 0 weekly downloads. As such, eris-contracts-promise popularity was classified as not popular.
We found that eris-contracts-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.