
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@originprotocol/origin
Advanced tools
Welcome to the origin.js documentation! origin.js is a Javascript library for interacting with the Origin protocol. Using the library you can create new listings from your applications, purchase them, or update them from your own off-chain applications.
More information can be found at Origin Platform Readme
This is still an alpha version which will evolve significantly before the main net release.
npm install @originprotocol/origin --save
yarn add @originprotocol/origin
For developing on origin.js
, it is better to link the package rather than installing it. (Otherwise you would need to run npm build
everytime you made a change to the package.)
In the directory ./packages/contracts/
run:
truffle compile
This will create the .json
files for our solidity contracts.
In the directory ./packages/origin.js
run:
npm link
Now change tabs (or diectories) to the repo for your DApp (for example, the Origin demo-dapp) run:
npm link @originprotocol/origin
This will create a symlink, direcly linking the dapp to your local origin.js
package.
Next, you will need to start your local development blockchain.
In the directory ./packages/contracts/
run:
truffle develop
Then in the console run:
migrate --reset
import { contractService, ipfsService, originService } from '@originprotocol/origin'
If you are running a local IPFS daemon then set the following environment variables:
export IPFS_DOMAIN=127.0.0.1
export IPFS_API_PORT=5001
export IPFS_GATEWAY_PORT=8080
export IPFS_GATEWAY_PROTOCOL=http
Configure your local IPFS daemon with the following settings to avoid CORS errors:
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["localhost:*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["GET", "POST", "PUT"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
If you have Python 3 installed, you may see this error when installing dependencies:
gyp ERR! stack Error: Python executable "/Users/aiham/.pyenv/shims/python" is v3.6.4, which is not supported by gyp.
Resolve this by configuring npm to use Python 2 (where python2.7 is a binary accessible from your $PATH):
npm config set python python2.7
When you begin developing, run npm test
and keep it running while you develop.
View test results in your browser (with MetaMask installed and setup) at http://localhost:8081
Tests are automatically rerun when source or test code is changed.
Run a subset of tests using the grep
query string parameter, for example: http://localhost:8081/?grep=IpfsService
Needed
FAQs
## Introduction
The npm package @originprotocol/origin receives a total of 0 weekly downloads. As such, @originprotocol/origin popularity was classified as not popular.
We found that @originprotocol/origin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.