Orbitdb docstore restict delete to the creator - restriction

I'm trying to understand how orbitdb works.
I've got several nodes that need to communicate between each other. The first step I want to achieve is when they start, they announce themselves and write in a public orbitdb docstore (with an IPFS access controller).
The problem is each person who has the address of the public DB can write and remove every record in this DB.
Is it possible to restrict Record deletion to the node that has created it ?

Related

How to fetch raw data from Binance Smart Chain (txs for specific address)

I am not sure what I don't know and if this is possible. I think this would be a similar issue for Ethereum, so that is the reason why I marked Ethereum on tags.
I am going to describe on example what I want to achieve:
There is a token called "Elonomics".
https://bscscan.com/address/0xd3ecc6a4ce1a9faec1aa5e30b55f8a1a4b84f938
there is owner with address "0x3a78ea5c462f0afa76fa091a70a7bcd020b274d6"
there are all txs from owner address: https://bscscan.com/txs?a=0x3a78ea5c462f0afa76fa091a70a7bcd020b274d6
when I take one of the transaction from the owner e.g. 0x6f81f2dbd285d772c6b34151b676f6749ef75ac9a6c76b5e4dfa844a0c6932d2"
I can read the logs from this transaction in:
https://bscscan.com/tx/0x6f81f2dbd285d772c6b34151b676f6749ef75ac9a6c76b5e4dfa844a0c6932d2#eventlog
so I can read that somebody set "totalSupply :1500000800000"
and now are my questions:
Is it possible to fetch all txs related to this specific owner address with these logs in json data (or any other data that can be updated dynamically on dAPPs)?
Are data from txs logs are encrypted? (if yes what is the format of this and how to decrypt this how bscscan do)
Is it possible to fetch these data directly from blockchain instead of using 3rd part application like bscscan?
Is it possible to fetch all txs related to this specific owner address with these logs in json data (or any other data that can be updated dynamically on dAPPs)?
Yes, because all this data is stored on a blockchain.
Are data from txs logs are encrypted? (if yes what is the format of this and how to decrypt this how bscscan do)
All data on a public blockchain is public.
Is it possible to fetch these data directly from blockchain instead of using 3rd part application like bscscan?
Run your own BSC node. Please see web3.py library how to interact with an Ethereum based blockchain, like one that is BSC node.

`kops update cluster` returns multiple will create/modify resources

I have a Kubernetes cluster that uses 1.17.17. I want to increase the CPU/RAM of a node using KOPS. When running kops update cluster command, I expect it would return the preview of my old instance type VS new instance type.
However, it returns a long line of will create resources/will modify resources.
I want to know why it shows a long log of changes it will execute instead of showing only the changes I made for instance type. Also, if this is safe to apply the changes.
After you will do that cluster update you are going to do rolling update on that cluster. The nodes will be terminated one by one and the new ones are going to show. Also while one node is going down to be replaced with the new one the services inside that node are going to be shifted on that one . Small tip remove all poddistributionbudgets. Also the log is fine dont worry.

Can we restrict an account in Corda to accept only one specific state?

In My Corda project, I want to create a special account which can have only one specific type of state and do not accept if any other state is shared with it. While other accounts on the same node can accept other states too. Is that possible in Corda. If yes, then How?
you could do this a bunch of different ways.
Maybe the easiest way would be in the flow? You just want to create a rule that ensures only a certain account can run or have a flow run involving it.
Example:
// Create account by using sub flow (from inside a flow).
val accountInfo: StateAndRef<AccountInfo> = subFlow(CreateAccount("Roger's account"))
// Then look up the account by account ID and name.
accountService.accountInfo(accountInfo.state.data.name)
accountService.accountInfo(accountInfo.state.data.identifier.id)
Take a look at this link for the source docs. Good luck!
https://github.com/corda/accounts/blob/master/docs.md

How to limit nodes retrievable via Service module in Drupal?

I've put together a simple web service in my Drupal website, using the apposite module (Services). Now, i can check the endpoint "node" and "retrieve" inside the module, for it to expose content of nodes of my website, but i don't really want to include EVERY node in it. I'd rather want to expose only a couple of selected contents.
To explain myself better: i need to expose the content of my 'disclaimer' nodes to a mobile app, but activating the node-retrieve endpoint means all nodes are exposed and i don't really want it.
So, there's a way to limit which node must be exposed via the Service module endpoint node-retrieve?
You can use services_entity module, and use pagesize query parameter to return a specific number of nodes.
Example: return 15 nodes of type page
/api/node?pagesize=15&parameters[type]=page

Spring Data Neo4j + Spring Data Rest: Using a Natural Key for all CRUD operations instead of the Neo4J node Id

I'm writing writing a Spring Restful microservice that relies on Spring Data Rest and Spring Data Neo4J.
We don't want to expose the internal Neo4J node identifier in the HAL links of the JSON response. The reason being (as far as I understand) that these identifiers are reused by Neo4J in case of node deletion. If this is the case this will present us with data integrity problems. And so we'd rather use a natural key, for example, UUID. Please correct me if my assumption regarding the reuse of neo4J node Ids is wrong.
What we want to achieve is using a Natural Key for all CRUD operations instead of the node Id (ie: PUT http://localhost:8080/apiname/5448ae86-fe87-4daf-bfb5-985522a1cf14 with some body).
Our first approach was to extend NodeGraphRepositoryImp . E.g.
protected Node getById(UUID id) {
Node node = (Node) this.findByPropertyValue("uuid_id", id);
return template.getNode(node.getId());
}
And instantiate it by injecting a customized Neo4jTemplate in the Neo4J configuration.
However this approach doesn't work for the following reasons:
1) I cannot define any other idProperty different from the one annotated with #GraphId in the NodeEntity class. As a result Spring Data Rest ends up trying to assign the natural key (e.g. UUID) to the neo4j node id field (that is a Long) and fails on type conversion.
2) It seems that the Spring Data Neo4J is not using our custom class that extends NodeGraphRepositoryImpl but the original not extended NodeGraphRepositoryImpl class instead.
Maybe this approach is wrong. Could you please recommend a way to achieve it?
Thanks a lot for your help.
Spring Data Rest introduced a BackendIdConverter for overriding/customizing the field that gets exposed in the URIs.
Please have a look at DATAREST-155 (https://jira.spring.io/plugins/servlet/mobile#issue/DATAREST-155)
Can you give it a try?
You can also have a look at the following thread:
How can you customise self, parent, children links in spring data rest with neo4j