Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This gem is a secure RPC wrapper to connect to nodes launched by https://blockchainnode.io.
gem install blockchain-node
The client is secured using a client-credentials OAUTH flow. You can generate API keys in your BCN account.
If you are using a Rails application, add the following initializer to config/initializers/blockchain_node.rb
BlockchainNode.configure do |config|
config.client_id = "CLIENT_ID"
config.client_secret = "CLIENT_SECRET"
end
Security Note:
It is recommended that you secure your CLIENT_ID
and CLIENT_SECRET
and do not check that into your code repo.
If your CLIENT_ID
and CLIENT_SECRET
are compromised, your wallet will be secure as long as it is
encrypted and not left unlocked.
# the node ID from your BCN console
node_id = "123ABC"
client = BlockchainNode::Client.new(node_id)
Make RPC method calls directly. Pass in parameters as args to the method call.
Other helper methods:
# returns a list of nodes you have running on your account
client.nodes
Notice, for geth, responses are returned in hex so they have to be converted to an integer.
Balances are stored as integers with 18 decimals of spacing (wei). Convert to ether. Helpful Calculator
resp = client.eth_blockNumber
Integer(resp[:response])
client.personal_listAccounts
resp = client.eth_getBalance("0xf4c2a25fcbaad4e568fb74d6644b164e999d3132", "latest")
Integer(resp[:response]) / 1000000000000000000.0
List of Ethereum (geth) RPC Calls
Comments and feedback are welcome. Send an email to matt at blockchainnode.io.
This code is free to use under the terms of the MIT license.
FAQs
Unknown package
We found that blockchain-node 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.